<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link href="css/user.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src='js/users.js'/></script>
<script type="text/javascript">
window.onload=function(){
	var a = document.getElementById('a1');
	var b = document.getElementById('a2');
	var c = document.getElementById('a3');
	var d = document.getElementById('b1');
	var e = document.getElementById('b2');
	  c.onclick=function(){
		var j;
		if(a.value==""&&b.value==""){
			d.style.display='block';
			e.style.display='block';
			j=false;
			}
			 else{
				d.style.display='none';
			    e.style.display='none';
			    j=true;
				}
		if(j){
		   var t;
		   for(var i=0;i<users.length;i++){
		   if(a.value==users[i].account&&b.value==users[i].password){
				t=true;
				//一个不对就往下找alert('登陆成功');
				break;
			    }else{
				t=false;		
				//一个不对就往下找 alert('用户名与密码不匹配,请重新输入');
			   }
		    }
		    if(t==true){
				alert('登陆成功');
				}else{
					alert('用户名与密码不匹配,请重新输入');
					}
			      }
  	            }
             }


</script>

</head>

<body>
<div class="box">
    <div class="b-right"><img src="images/a3.png" width="500" height="500"></div>
    <div class="b-left">
       <div class="r1">标题</div>
       <div class="r2">账号：</div>
       <div class="r3"><input id="a1" name="" type="text" value="">
       <a id="b1" href="#">用户名不能为空</a></div>
       <div class="r4">密码：</div>
       <div class="r5"><input id="a2" name="" type="password" value="">
       <a id="b2" href="#">密码不能为空</a></div>
       <div class="r6"><input id="a3" name="" type="button" value="登录"></div>
       <div class="r7">微信，QQ等登录</div>
    </div>
</div>


</body>
</html>
